package com.sky.mapper;

import com.sky.entity.DishFlavor;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;

import java.util.List;

//启动类配置了MapperScan，所以这里不用添加@Mapper
public interface DishFlavorMapper {

    /**
     * 批量插入口味数据
     * @param dishFlavors
     */
    void insertBatch(List<DishFlavor> dishFlavors);

    /**
     * 根据菜品id删除口味数据（批量操作）
     * @param dishids
     * @return
     */
    void deleteByDishId(List<Long> dishids);

    /**
     * 根据菜品id查询口味数据
     * @return
     */
     @Select("select * from dish_flavor where dish_id = #{id}")
     List<DishFlavor> selectByDishId(Long id);

     /**
     * 根据菜品id删除单挑菜品的口味数据
     * @param id
     */
     @Delete("delete from dish_flavor where dish_id = #{id}")
    void delByDishId(Long id);
}
